package org.example.mapper;

import org.example.dto.UserResp;
import org.example.entity.User;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * @author yangdc
 * @date 2025/4/23
 */

@Mapper
public interface UserMapper {
    // ----------------6、使用表达式转换----------------
    @Mapping(target = "fullName",
            expression = "java(user.getFirstName() + user.getLastName())")
    UserResp toUserResponse(User user);
}
